<template>
  <el-form ref="loginForm" :model="loginForm" :rules="loginRules"
           class="login-form" auto-complete="on" label-position="left">
    <div class="title">欢迎登录</div>
    <div class="title-container">
      <!-- <el-image
            v-if="platformLogo"
            style="width: 32px; height: 32px"
            :src="platformLogo"
          /> -->
      <!-- <el-image
            style="width: 32px; height: 32px"
            :src="require('@/framework/assets/HBISlogo.png')"
          /> -->
      <div class="title">
        {{ platformName }}
      </div>
    </div>
    <el-form-item prop="tenantId">
      <!-- <el-select ref="tenantId" v-model="loginForm.tenantId" placeholder="请选择租户"
                 clearable style="width: 100%;">
        <el-option
          v-for="item in selectList"
          :key="item.id"
          :label="item.tenantName"
          :value="item.tenantId"
        />
      </el-select> -->
    </el-form-item>
    <el-form-item prop="account">
      <!-- <span class="svg-container">
            <svg-icon icon-class="user" />
          </span> -->
      <el-input
        ref="account"
        v-model="loginForm.account"
        placeholder="请输入用户名"
        name="account"
        type="text"
        tabindex="1"
        maxlength="20"
        auto-complete="on"
      >

        <span slot="prefix" class="svg-container">
          <svg-icon icon-class="user_login" class="el-input__icon input-icon" />
        </span>
      </el-input>
    </el-form-item>

    <el-form-item prop="password">
      <!-- <span class="svg-container">
            <svg-icon icon-class="password" />
          </span> -->
      <el-input
        :key="passwordType"
        ref="password"
        v-model="loginForm.password"
        :type="passwordType"
        placeholder="请输入密码"
        name="password"
        tabindex="2"
        maxlength="20"
        auto-complete="off"
        @keyup.enter.native="handleLogin"
      >
        <span slot="prefix" class="svg-container">
          <svg-icon icon-class="lock_black" class="el-input__icon input-icon" />
        </span>
        <span slot="suffix" class="svg-container show-pwd" @click="showPwd">
          <svg-icon :icon-class="passwordType === 'password' ? 'hide_login' : 'vector_login'" class="el-input__icon input-icon" />
        </span>
      </el-input>
      <!-- <span class="show-pwd" @click="showPwd">
            <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
          </span> -->
    </el-form-item>

    <el-button :loading="loading" type="primary" class="loginbtn"
               style="width:100%;" @click.native.prevent="handleLogin">
      {{ $t('login.logIn') }}
    </el-button>

  </el-form>
</template>
